<?php

namespace App\Service;

use Elastic\Elasticsearch\ClientBuilder;

class Es
{
    private static $use=null;
    private  $es;
    private function __construct(){
        $host=['127.0.0.1:9200'];
        return $this->es = ClientBuilder::create()
            ->setHosts($host)
            ->build();
    }

    private function __clone()
    {
        // TODO: Implement __clone() method.
    }

    public static function connting(){
        if(self::$use==null){
            self::$use=new self();
        }
        return self::$use;
    }

    public    function doConnting($params){

        return  $this->es->create($params);

    }

}
